//
//  ViewController.swift
//  3D矩阵变换的基本道理
//
//  Created by app on 2017/4/18.
//  Copyright © 2017年 app. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    var imageView = UIImageView()
    override func viewDidLoad() {
        super.viewDidLoad()
        
        imageView.frame = CGRect(x: 0, y: 0, width: 400, height: 300)
        imageView.center = view.center
        imageView.image = UIImage(named: "1")
        imageView.contentMode = .scaleAspectFit
        imageView.layer.anchorPoint = CGPoint(x: 0, y: 0)
        view.addSubview(imageView)
        
        UIView.beginAnimations(nil, context: nil)
        UIView.setAnimationDuration(4)
        imageView.layer.transform = CATransform3DMakeRotation(CGFloat(M_PI / 2), 1, 1, 0)
        UIView.commitAnimations()
    }


}

